<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    #d1{
      width: 100px;
      height: 50px;
      background-color: red;
      position: absolute;
      z-index: 1;
    }
    #d2{
      width: 50px;
      height: 100px;
      background-color: green;
      position: absolute;
      /*当元素为非static定位时，可能会出现层叠显示的问题，通过z-index*/
      /*设置Z轴胡位置  值越大越靠前*/
      z-index: 2;
    }
  </style>
</head>
<body>
<div id="d1"></div>
<div id="d2"></div>
</body>
</html>